import 'package:flutter/material.dart';
import '../models/notice.dart';
import '../services/home_service.dart';

class HomeProvider with ChangeNotifier {
  final HomeService _homeService = HomeService();

  List<Notice> _notices = [];
  bool _loading = false;

  List<Notice> get notices => _notices;
  bool get loading => _loading;

  Future<void> loadNotices() async {
    _loading = true;
    notifyListeners();

    _notices = await _homeService.getNoticeList();
    
    _loading = false;
    notifyListeners();
  }
}
